/* GUI CONVERTED from rciq03a.p (converter v1.76) Fri May  3 13:21:13 2002 */
/* rciq03a.p - Release Management Customer Schedules                          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.10.1.7 $                                                      */
/*V8:ConvertMode=Report                                                       */
/* REVISION: 7.3    LAST MODIFIED: 10/16/92           BY: WUG *G462*          */
/* REVISION: 7.3    LAST MODIFIED: 02/18/83           BY: WUG *G695*          */
/* REVISION: 7.4    LAST MODIFIED: 11/17/94           BY: jxz *GO50*          */
/* REVISION: 7.3    LAST MODIFIED: 03/28/95           BY: bcm *G0JH*          */
/* REVISION: 7.4    LAST MODIFIED: 09/15/95           BY: vrn *G0VP*          */
/* REVISION: 8.5    LAST MODIFIED: 06/25/96           BY: taf *J0WC*          */
/* REVISION: 8.6    LAST MODIFIED: 05/13/97   BY: *J1R4* Molly Balan          */
/* REVISION: 8.6    LAST MODIFIED: 10/10/97   BY: *K0KF* Joe Gawel            */
/* REVISION: 8.6    LAST MODIFIED: 10/23/97   BY: *K14Y* CK Mohan             */
/* REVISION: 8.6    LAST MODIFIED: 12/13/97   BY: *J20Q* Aruna Patil          */
/* REVISION: 8.6E   LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane            */
/* REVISION: 8.6E   LAST MODIFIED: 08/29/98   BY: *J2XV* Aruna Patil          */
/* REVISION: 9.1    LAST MODIFIED: 09/23/99   BY: *K230* Santosh Rao          */
/* REVISION: 9.1    LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane     */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown           */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.10.1.4     BY: Jean Miller    DATE: 03/22/01 ECO: *P008*       */
/* Revision: 1.10.1.5     BY: Ellen Borden   DATE: 07/09/01 ECO: *P007*       */
/* $Revision: 1.10.1.7 $    BY: Katie Hilbert  DATE: 04/15/02 ECO: *P03J*       */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* SHIPPER/CONTAINER INQUIRY SUBPROGRAM */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

{wbrp02.i}

define input parameter abs_recid as recid.
define input parameter indent_ct as integer.

define variable disp_abs_id      as character no-undo.
define variable indent_id        as character format "x(12)" no-undo.
define variable par_shipfrom     as character no-undo.
define variable par_id           as character no-undo.
define variable l_shipper_po     like sod_contr_id format "x(22)" no-undo.
define variable v_absd_fld_seq   like absd_fld_seq   no-undo.
define variable v_absd_fld_name  like absd_fld_name  no-undo.
define variable v_absd_fld_value like absd_fld_value no-undo.

/* VARIABLE DEFINITIONS FOR gpfile.i */
{gpfilev.i}

define shared frame c.
FORM /*GUI*/ 
   indent_id    column-label "ID!Site"
   abs_item     column-label "Item Number!Location!Customer Ref"
   scx_po       column-label "PO Number!Lot/Serial!Model Year" format "x(16)"
   scx_order    column-label "Order!Ref"
   scx_line     column-label "Line!Stat"
   abs_qty      format "->,>>>,>>9.9<<<<<<<<"
   pt_um
with STREAM-IO /*GUI*/  frame c down width 80.

/* SET EXTERNAL LABELS */
setFrameLabels(frame c:handle).

/* FORM STATEMENT FOR CONTAINER/LINE CHARGES USER FIELDS FRAME */
FORM /*GUI*/ 
   v_absd_fld_seq
   v_absd_fld_name
   v_absd_fld_value
with STREAM-IO /*GUI*/  down frame absd_user_fields width 80.

/* SET EXTERNAL LABELS */
setFrameLabels(frame absd_user_fields:handle).

find abs_mstr where recid(abs_mstr) = abs_recid AND LOOKUP(ABS_shipfrom,GLOBAL_user_site) > 0 no-lock.  /*fdn*/

find pt_mstr where pt_part = abs_item no-lock no-error.

/* IS CONTAINER/LINE CHARGES ACTIVE? */
{cclc.i}

if indent_ct = 0 then
   indent_id = substring(abs_id,2).
else
   indent_id = substring("...........",1,indent_ct) + if abs_id begins "I"
               then
                  "I"
               else
                  abs_id.

find so_mstr where so_nbr = abs_order no-lock no-error.

find sod_det where sod_nbr = abs_order and
                   sod_line = integer(abs_line)
no-lock no-error.

if available sod_det then do:

   if sod_sched then
      l_shipper_po = sod_contr_id.
   else
   if available so_mstr then
      l_shipper_po = so_ship_po.
end. /* IF AVAILABLE SOD_DET */

if not available sod_det then do:

   for first idh_hist
   fields(idh_contr_id idh_line idh_nbr idh_part
          idh_sched idh_custref idh_modelyr)
   where idh_nbr  = abs_order and
         idh_line = integer(abs_line) and
         idh_part = abs_item
   no-lock: end. /* FOR FIRST IDH_HIST */

   if available idh_hist then do:

      if idh_sched then
         l_shipper_po = idh_contr_id.

      else do:

         for first ih_hist
            fields(ih_nbr ih_ship_po)
            where ih_nbr = idh_nbr
         no-lock:
            l_shipper_po = ih_ship_po.
         end. /* FOR FIRST IH_HIST */

      end. /* ELSE DO */

   end. /* IF AVAILABLE IDH_HIST */
   else
      l_shipper_po = "".

end. /* IF NOT AVAILABLE SOD_DET */

display
   indent_id
   abs_item
   l_shipper_po @ scx_po
   abs_order    @ scx_order
   string(integer(abs_line),">>>9") format "x(4)" @ scx_line
   abs_qty      when (abs_qty <> 0)
   abs__qad02   @ pt_um
with frame c STREAM-IO /*GUI*/ .

down 1 with frame c.

display
   abs_site   @ indent_id
   abs_loc    @ abs_item
   abs_lotser @ scx_po
   abs_ref    @ scx_order
   (if available so_mstr then ("  " + so_stat) else "")
      format "x(4)" @ scx_line

with frame c STREAM-IO /*GUI*/ .

down 1 with frame c.

display
    sod_custref when (available sod_det)  @ abs_item
    idh_custref when (available idh_hist) @ abs_item
    sod_modelyr when (available sod_det)  @ scx_po
    idh_modelyr when (available idh_hist) @ scx_po
with frame c STREAM-IO /*GUI*/ .

down 1 with frame c.

clear frame absd_user_fields all no-pause.

/* FIND CONTAINER/LINE CHARGES HEADER USER FIELDS AND DISPLAY */
if using_container_charges or using_line_charges then do:
   for each absd_det no-lock where
      absd_abs_id = abs_id  and
      absd_shipfrom = abs_shipfrom AND LOOKUP(absd_shipfrom,global_user_site) > 0   /* fdn*/  :

      display
         absd_fld_seq   @ v_absd_fld_seq
         absd_fld_name  @ v_absd_fld_name
         absd_fld_value @ v_absd_fld_value
      with frame absd_user_fields STREAM-IO /*GUI*/ .

      down 1 with frame absd_user_fields.
   end. /* FOR EACH absd_det */
end. /* IF using_container or using_line_charges */

assign
   par_shipfrom = abs_shipfrom
   par_id = abs_id.

for each abs_mstr
   where abs_shipfrom = par_shipfrom
     and abs_par_id = par_id AND LOOKUP(ABS_shipfrom,global_user_site) > 0      /*fdn*/
no-lock:

   if keyfunction(lastkey) = "END-ERROR" then
      leave.

   {gprun.i ""hkrciq03a.p""
      "(input recid(abs_mstr), input (indent_ct + 1))"}

end.

{wbrp04.i}
